<%@ page import="top.dingyingying.study.javawebjdbc.entity.TbClass" %>
<%@ page import="java.util.List" %>
<%@ page import="top.dingyingying.study.javawebjdbc.dao.TBClassDAO" %><%--
  Created by IntelliJ IDEA.
  User: Lenvov
  Date: 2024/5/16
  Time: 15:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>班级列表</title>
</head>
<body>

<%
    List<TbClass> list = TBClassDAO.query();
%>

<h1>
    <a href="insert.jsp">班级添加</a>
</h1>

<table border="1" style="width: 100%">

    <thead>
    <tr>
        <th>编号</th>
        <th>名称</th>
        <th>简介</th>
        <th>创建时间</th>
        <th>操作</th>
    </tr>
    </thead>


    <tbody>

    <%
       for (TbClass tbClass : list){
    %>
    <tr>
        <td><%=tbClass.getId()%></td>
        <td><%=tbClass.getClassname()%></td>
        <td><%=tbClass.getClassinfo()%></td>
        <td><%=tbClass.getCreated()%></td>
        <td>
            <a href="delete.jsp?id=<%=tbClass.getId()%>">删除</a>
        </td>
    </tr>

    <% } %>

    </tbody>

</table>


</body>
</html>
